package com.hospital.medicals.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hospital.medicals.entity.MedicalUser;
import com.hospital.medicals.mapper.MedicalUserMapper;
import com.hospital.medicals.service.MedicalUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class MedicalUserServiceImpl extends ServiceImpl<MedicalUserMapper, MedicalUser> implements MedicalUserService {
    private MedicalUserMapper mapper;

    @Override
    public List<MedicalUser> list() {
        return mapper.getSelect();
    }

    @Override
    public int saveMedicals(MedicalUser medicalUser) {
        return mapper.insert(medicalUser);
    }

    @Override
    public void deleteMedicals(int id) {
        mapper.deleteMedical(id);
    }

    @Override
    public void updateMedicals(MedicalUser medicalUser) {
        mapper.updateMedical(medicalUser);
    }

    @Override
    public MedicalUser findById(int id) {
        return mapper.selectById(id);
    }
}
